function getChild(elem) {
    var id2 = $(elem).find("option:selected").val();
    var url = "getChild.html";
    $.post(url, {id: id2}, child, 'json');
}
function child(data) {
    $("#child").empty();
    $("#child").append("<option value='' selected=''>请选择</option>");
    for (var i = 0; i < data.length; i++) {
        var id = data[i].id;
        var name = data[i].name;
        $("#child").append("<option value = '" + id + "'>" + name + "</option>");
    }
}
function setInsurerName(elem) {
    var name = $(elem).find("option:selected").text();
    if (name != "请选择") {
        $("input[name=insurerName]").val(name);
    }
    else {
        $("input[name=insurerName]").val('');
    }
}

function setPropName(elem) {
    var name = $(elem).find("option:selected").text();
    if (name != "请选择") {
        $("input[name=propName]").val(name);
    }
    else {
        $("input[name=propName]").val('');
    }
}


function addFileUploadBox(name,textName)
{
    if (!document.getElementById || !document.createElement)
        return false;

    var uploadArea = document.getElementById (name);
    if (!uploadArea && !textArea)
        return;

    var newLine = document.createElement ("br");
    uploadArea.appendChild (newLine);

    var newUploadBox = document.createElement ("input");
    var newtextBox = document.createElement ("input");
    // Set up the new input for file uploads
    newUploadBox.type = "file";
    newtextBox.type = "text";
    // The new box needs a name and an ID
    if (!addFileUploadBox.lastAssignedId)
        addFileUploadBox.lastAssignedId = 100;

    newUploadBox.setAttribute ("name",name);
    newtextBox.setAttribute("name",textName);
    uploadArea.appendChild (newUploadBox);
    uploadArea.appendChild(newtextBox);
}

function upload(){
    var all = "";
    $("input[name=featureFile]").each(function(){
        all += jQuery(this).val()+",";
    });
    alert(all);



}